package branch.feature.qrcode_scan;


import android.Manifest;
import android.content.Intent;
import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;

import com.example.mynewsapp.databinding.ActivityScanQrBinding;


// todo: fix the code
// ref link:
public class ScanActivity extends AppCompatActivity {
    private ActivityScanQrBinding binding;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        binding = ActivityScanQrBinding.inflate(getLayoutInflater());
        setContentView(binding.getRoot());

        binding.btnScanTest1.setOnClickListener(v -> {
            Intent intent = new Intent(this, branch.feature.qrcode_scan.ScanStyle1Activity.class);
            startActivity(intent);
        });

        binding.btnScanTest2.setOnClickListener(v -> {

        });

        ActivityCompat.requestPermissions(this,
                new String[]{Manifest.permission.CAMERA, Manifest.permission.READ_EXTERNAL_STORAGE},
                1
        );
    }
}
